package com.ponhu.ea2.enums;

/**
 * AI接口调用状态枚举
 */
public enum SyncAiDataStatusEnum {

    SUCCESS(1, "调用成功，识别成功"),
    FAIL(2, "调用成功，识别失败"),
    ERROR(3, "调用失败"),
    ;

    private Integer code;

    private String name;

    SyncAiDataStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(Integer code) {
        if (code == null)  return null;
        for (SyncAiDataStatusEnum c : SyncAiDataStatusEnum.values()) {
            if (code.equals(c.getCode())) {
                return c.name;
            }
        }
        return null;
    }

}
